#!/usr/bin/env bash

eureka_server=order-eureka-0.0.1-SNAPSHOT.jar
user_provider=user-provider-0.0.1-SNAPSHOT.jar
order_zuul=order-zuul-0.0.1-SNAPSHOT.jar

PID=$(ps -ef | grep $eureka_server | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill $PID
fi

PID=$(ps -ef | grep user_provider | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill $PID
fi


PID=$(ps -ef | grep order_zuul | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]
then
    echo Application is already stopped
else
    echo kill $PID
    kill $PID
fi
